from django.urls import path
from django.contrib.auth.decorators import login_required
from .views import AppInputCreateView, AppInputUpdateView, AppInputDetailView, AppInputListView

# Django App 的命名空间，在html中的url中引用时，比如{% url 'appinput:list' %}
app_name = 'appinput'
urlpatterns = [
    path('create/', login_required(AppInputCreateView.as_view()), name='create'),
    path('list/', login_required(AppInputListView.as_view()), name='list'),
    # slug是路径转换器，还有其他四个为：str,int,uuid,path共五个
    path('edit/<slug:pk>/', login_required(AppInputUpdateView.as_view()), name='edit'),
    path('view/<slug:pk>/', login_required(AppInputDetailView.as_view()), name='detail'),
]
